package com.wind.cloud.demo.feign.fallback;

import com.wind.cloud.demo.feign.HelloFeignService;
import com.wind.cloud.demo.vo.ParamVo;
import com.wind.cloud.demo.vo.ResultVo;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class HelloFeignServiceFallbackImpl implements HelloFeignService {

    @Setter
    private Throwable cause;

    @Override
    public String hello(String param) {
        log.error("feign 调用异常", cause);
        return "hello fallback";
    }

    @Override
    public ResultVo hello(ParamVo param) {
        log.error("feign 调用异常", cause);
        ResultVo vo = new ResultVo();
        vo.setCode(-1);
        vo.setMsg("FAIL");
        return vo;
    }
}
